package com.woniu.his.bms.client;

import com.woniu.his.bms.client.result.BillRecordResult;
import com.woniu.his.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.util.List;


/**
 * @version: java version 1.8
 * @Author: ZJH
 * @description:
 * @date: 2022-11-30 16:25
 */
@FeignClient(contextId = "BillRecordClient",name = "bms",path = "bms")
public interface BillRecordClient {

    /**
     * 创建账单
     * @param billType
     * @return
     */
    @GetMapping("createBillBillType")
    Result<BillRecordResult> createBillRecord(@RequestParam("billType") String billType,
                                              @RequestParam("amount") BigDecimal amount);

    /**
     * 创建账单
     * @param billType
     * @param caseHistoryId
     * @return
     */
    @GetMapping("createBillCaseHistoryId")
    Result<BillRecordResult> createBillRecord(@RequestParam("billType")String billType,
                                              @RequestParam("amount") BigDecimal amount,
                                              @RequestParam("caseHistoryId") Long caseHistoryId);

    /**
     * 通过病历id查询所有未支付账单
     * @param caseHistoryId
     * @return
     */
    @GetMapping("queryBillRecord")
    Result<List<BillRecordResult>> queryBillRecord(@RequestParam("caseHistoryId") Long caseHistoryId);

    /**
     * 账单支付
     * @param billId
     * @return
     */
    @GetMapping("billPay")
    Result<String> billPay(@RequestParam("billId") Long billId) throws  IOException;


    @GetMapping("paySuccess")
    void paySuccess();

}
